Component({
	properties: {
		matches: {
			type: Array,
			value: []
		},
		'channelName': {
			type: String,
			value: '',
		}
	},
	data: {
		selected: {},  // 当前选中筛选项
		currentMenu: {},  // 当前选择的下拉菜单
		menuTitle: {}  // 当前筛选项显示
	},
	ready(){
		console.log(this.properties.channelName)
	},
	methods: {
		menuDown(e) {  // 展示下拉框
			let filtertype = e.currentTarget.dataset.type;
			let selected = this.data.selected;
			if (e.detail.value != -1) {
				selected[filtertype] = e.detail.value
				this.setData({
					selected
				})
			} else {
				selected[filtertype] = undefined
				this.setData({
					selected
				})
			}
		},
		current(e) {  // 获取当前筛选项
			let typeid = e.currentTarget.dataset.typeid;  // 当前专业id
			let val = e.currentTarget.dataset.val  // 当前专业
			if (this.properties.channelName == 'majorfilter'){
				wx.reLaunch({
					url: '/pages/list-page/list-page?filters=major&title=' + val
				})
			} else {
				wx.reLaunch({
					url: '/pages/list-page/list-page?filters=address&title=' + val
				})
			}
			
			this.triggerEvent('current', this.data.selected)
		}
	}
})
